#coding: utf8

#Import Modules
import pygame

from Units import *
from Util import *
from GameScenes import *

def main():
	'''
		Direcao :	 (-0.134862029954,-0.00857729836663)  (0.000545384371525,0.000666385695798)  (-0.0104663259144,0.0010804880228)  (-0.0172602286739,0.000963252602096)  (-8.26422423296e-005,-0.000114675320034)  (0.00244845446258,0.000859846683494)  (-0.00038929020902,5.70736946614e-005)  (-0.000703085063558,-0.000250794883141)  (0.165314001281,-0.255077835333)  (-0.000172447198571,-0.000113195989224)  (-0.00836484451741,0.0120503627619)  (0.00119248323352,0.000382605067973)  (0.0583920273183,-0.0510693148346)  (-0.000311618842785,-0.00042884108727)  (0.575904155634,-1.13205879938)  (0.000570232869846,0.000335128606107)  (-1.97305659943,-0.674004600117)  (0.00144609099544,0.00179156552281)  (0.146846607869,-0.238262779088)  (-0.00251526029349,-0.00131309985955)  (0.000313981000831,-0.000403274553004)  (0.000472864550222,9.79225484275e-005)  (-0.000130683359358,0.00018079093998)  (0.000333317867414,-0.000175513921082)  (-1.07687739697,-0.0395052333528)  (0.000333708612459,-0.000644680886863)  (8.2068397337e-005,-0.00039901567284)  (0.000131186251486,0.000514043007326)  (0.000175337441478,0.000957441171287)  (-0.000127938500729,-0.00020823767845)  (-0.000399506178052,-0.00126579109736)  (-0.000266518708855,-0.000495866299128)  (3.76689584658e-005,0.000577340429988)  (0.000286259561108,0.000439532537347)  (-0.00434427755769,0.00829834264593)  (-4.0341162049e-005,-0.000379560265802)  (0.171703973111,-0.112956242104)  (-7.30928860631e-005,-3.70606610129e-005)  (-0.982678239519,-0.638768431994)  (-9.81721452106e-005,0.000607547983128)  (0.0643125925329,-0.629205419726)  (-0.0258357849984,0.188675453754)  (-0.0737668491356,-0.216328815795)  (-0.13452244265,-0.210126600154)  (-0.0967824539717,-0.0821174518634)  (-0.0461224715685,-0.0666152778135)  (0.134858729935,-0.0450008336283)  (0.000109236710959,6.18314461031e-005)  (1.20819055839,-0.36941819546)  (-0.00088949327156,-0.0023382259747)  (0.13329376532,-0.0370722634855)  (0.00101803367072,0.00237405172154)  (-0.0068541663756,0.00129283101801)  (-0.000366783150168,-9.00204821368e-005)  (0.00699535724228,-0.00530193734278)  (0.0160927479205,-0.0109332913954)  (0.00234682154293,-0.0111894560964)  (0.0526806124469,0.00524351636735)  (0.000117211777517,4.57624409534e-006)  (0.395015783652,0.0298921422583)  


		XK :	 (178.676063428,119.88765888)  (175.611899731,120.935345617)  (175.25252042,125.275654403)  (176.402843716,130.937580952)  (178.120099541,136.176918501)  (179.416910412,140.848532107)  (178.582524698,145.372552647)  (175.78477262,150.162758149)  (169.499952501,153.71457553)  (161.040090287,156.08206128)  (151.738275996,157.889468296)  (144.955991304,160.351170652)  (144.065803823,164.666643046)  (145.408385542,166.109829915)  (145.255377944,165.413445593)  (146.128912133,163.773629038)  (149.831495653,163.801356848)  (155.954134331,167.297739069)  (169.163915753,179.618966564)  (179.796704123,192.822996262)  (178.08840004,199.578860866)  (177.795805463,204.289013517)  (177.256172645,208.421988593)  (176.089541957,213.426918014)  (176.557846515,217.552898205)  (177.757610303,218.911063221)  (180.604534943,217.062483906)  (183.876100931,213.234241494)  (187.779724985,210.19494383)  (192.54367378,211.845906616)  (196.759967347,212.393904795)  (199.002583772,206.701336408)  (200.230876057,198.469491607)  (201.647647202,193.064235927)  (204.469107024,189.840132128)  (207.25055251,186.500662356)  (209.844998135,181.285265872)  (213.576053286,174.620843533)  (216.966346543,167.766297258)  (221.008760101,161.498465975)  (224.571509298,158.231993043)  (227.642445899,156.74336546)  (230.128907977,156.596021459)  (231.970382218,157.117890277)  (233.198402621,157.907479473)  (234.012502876,158.826021787)  (234.733091259,159.837429013)  (235.73820576,160.988905255)  (237.237382085,162.383940682)  (234.227982927,157.566220748)  (226.814485112,141.226213679)  (219.438135488,124.938661536)  (217.057440523,120.341841984)  (215.179537186,121.121430971)  (211.495916514,121.509252158)  (206.517911119,121.570590189)  (200.747785819,121.377275509)  (194.667491467,121.014741517)  (188.755967849,120.582366124)  (183.426346176,120.172955387)  

	
	'''
	#Initialize Everything
	screen = pygame.display.set_mode( (300,300) )
	pygame.init()
	pygame.display.set_caption('Selecionando uma curva')
	pygame.mouse.set_visible(1)

	#Prepare Game Objects
	clock = pygame.time.Clock()
	
	cenaAtual = InitialScene()
	screen = pygame.display.set_mode( cenaAtual.get_size() )	

	#Main Loop
	going = True
	while going:
		clock.tick(60)

		#Handle Input Events
		for event in pygame.event.get():
			cenaAtual.fireEvent(event)
			
			if event.type == QUIT:
				going = False
			elif event.type == KEYDOWN and event.key == K_ESCAPE:
				going = False				
				
		cenaAtual.update()

		#Draw Everything
		cenaAtual.draw()
		screen.blit(cenaAtual.get_surface(),(0,0))
		pygame.display.flip()

	pygame.quit()

	#Game Over


#this calls the 'main' function when this script is executed
if __name__ == '__main__':
	main()

	
